package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("userShopController")
@RequestMapping("/user/shop")
@Api(tags = "商铺管理")
@Slf4j
public class ShopController {

    @Resource
    private RedisTemplate redisTemplate;



    @GetMapping("/status")
    @ApiOperation("获取商铺状态")
    public Result<Integer> getStatus() {
        Object shopStatus = redisTemplate.opsForValue().get("SHOP_STATUS");
        Integer status = (Integer) shopStatus;
        log.info("获取商铺状态:{}", shopStatus);
        return Result.success(status);
    }
}
